﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace SmallSpider.Dal
{
    public class Dal_DomainSuffix : Dal_Base
    {
        public void InsertDomainSuffix(string strSuffix, string strDescription, string strKeywords, string strDesc, DataTable dt)
        {
            using (SqlConnection con = new SqlConnection(strConnectionString))
            {
                //创建SqlDataAdapter   
                SqlDataAdapter adp = new SqlDataAdapter();
                //创建InsertCommand命令    
                adp.InsertCommand = new SqlCommand("DomainSuffix", con);
                //指定InsertCommand类型为存储过程   

                adp.InsertCommand.Parameters.Add(new SqlParameter("@SUFFIX", SqlDbType.VarChar, 50, "SUFFIX"));
                adp.InsertCommand.Parameters.Add(new SqlParameter("@DESCRIPTION", SqlDbType.NVarChar, 100, "DESCRIPTION")); 
                
                DataRow row = dt.NewRow();
                row["SUFFIX"] = strSuffix;
                row["DESCRIPTION"] = strDescription;
                 
                dt.Rows.Add(row);
                //更新数据库  
                adp.Update(dt); 
            }
        }
    }
}
